package com.slz3.business.module.systemManagement.sysRoleUser.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysRoleUser.domain.SysRoleUser;
import com.slz3.business.module.systemManagement.sysRoleUser.domain.SysRoleUserCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class SysRoleUserResAtomic {

    public Mono<ServerResponse> add_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUser sysRoleUser) {
        return SysRoleUserResSafeValid.add(req, sysRoleUser) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.add(req, sysRoleUser);
    }

    public Mono<ServerResponse> delete_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUserCondition sysRoleUserCondition) {
        return SysRoleUserResSafeValid.delete(req, sysRoleUserCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUser sysRoleUser) {
        return SysRoleUserResSafeValid.modify(req, sysRoleUser) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.modify(req, sysRoleUser);
    }

    public Mono<ServerResponse> info_$SysRoleUserUpdateLock(ServerRequest req) {
        return SysRoleUserResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUserCondition sysRoleUserCondition) {
        return SysRoleUserResSafeValid.auditSubmit(req, sysRoleUserCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUserCondition sysRoleUserCondition) {
        return SysRoleUserResSafeValid.audit(req, sysRoleUserCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUserCondition sysRoleUserCondition) {
        return SysRoleUserResSafeValid.auditReject(req, sysRoleUserCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUserCondition sysRoleUserCondition) {
        return SysRoleUserResSafeValid.usingEnable(req, sysRoleUserCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$SysRoleUserUpdateLock(ServerRequest req, SysRoleUserCondition sysRoleUserCondition) {
        return SysRoleUserResSafeValid.usingDisable(req, sysRoleUserCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysRoleUserResExecutor.usingDisable(req);
    }
}
